<?php


namespace app\admin\pms\validate;


use app\common\validate\BaseValidate;

class GoodsCateValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require',
        'pid' => 'min:0',
        'name' => 'require',
        'sub_name' => 'must',
//        'desc' => 'must',
        'icon' => 'must',
        'big_pic' => 'must',
        'sort' => 'must',
        'is_recommend' => 'require',
        'status' => 'require',
    ];

    protected $field = [
        'id' => 'ID',
        'pid' => '上级分类',
        'name' => '分类名',
        'sub_name' => '分类副标题',
//        'desc' => '分类描述',
        'icon' => 'icon图标',
        'big_pic' => '大图',
        'sort' => '排序',
    ];
    protected $scene = [
        "id" => [
            'id',
        ],
        "add" => [
            'name',
            'pid',
            'sub_name',
//            'desc',
            'icon',
            'big_pic',
            'sort',
        ],
        "update" => [
            'id',
            'name',
            'pid',
            'sub_name',
//            'desc',
            'icon',
            'big_pic',
            'sort',
        ],
    ];
}